// Library exception

// ----------------------------------------------------------------------------

#include "stdafx.h"
#include "DSymLoadError.h"

// ----------------------------------------------------------------------------

namespace DSymLoad
{

// ----------------------------------------------------------------------------

CError::CError(__in const CStringA &csDescription, __in DWORD nErrorCode /*= ERROR_SUCCESS*/)
    : m_csDescription(csDescription), m_nErrorCode(nErrorCode)
{
    _ASSERT(!__FUNCTION__);
}

// ----------------------------------------------------------------------------

CError MakeFunctionCallError(
    __in PCSTR szFuctionName, 
    __in PCSTR szArguments /*= L"..."*/,
    __in DWORD nErrorCode /*= ::GetLastError()*/
)
{
    return CError(CStringA("Call ") + szFuctionName + "(" + szArguments + ")" + " failed", nErrorCode);
}

// ----------------------------------------------------------------------------

}   // namespace DSymLoad

// ----------------------------------------------------------------------------
